<?$page_title="View Site Log";?>
<? include("includes/header.php"); ?>
<?
$log_id=$_GET["log_id"];

$log_info=@array_pop(qry_data("select * from bkitc_log where log_id=".$log_id));
$detailed=0;
if($log_info["log_type"]==1){
$detailed=1;	
	$log_data=unserialize($log_info["log_content"]);
	$log_old=$log_data["old"];
	$log_new=$log_data["new"];

	$ctr=0;
	foreach($log_old as $logo){
		unset($log_old[$ctr]);
		$ctr++;
	}
	$ctr=0;
	foreach($log_new as $logn){
		unset($log_new[$ctr]);
		$ctr++;
	}
	$log_diff=array_diff_uassoc($log_new,$log_old,"compareLogData");
	
}

?>
<div class="fleft">
<ul class="subMenu">
<li><a href="site_log.php?mode=result">Back to Log List </a></li>
</ul>
</div>
<div class="cleardiv"></div>
<div>
<table class="section_panel" cellpadding="4" width="100%">
<tr>
	<td class="frmLabel">Log Date</td>
	<td><?=$log_info["log_date"]?></td>
</tr>
<tr>
	<td  class="frmLabel">Log User Type</td>
	<td><?=$log_types[$log_info["user_type"]]?></td>
</tr>
<tr>
	<td  class="frmLabel">Log Remarks</td>
	<td><?=$log_info["log_remarks"]?></td>
</tr>
<tr>
	<td  class="frmLabel">IP Address</td>
	<td><?=$log_info["ip_address"]?></td>
</tr>
<? if($detailed==1) { ?>
<tr>
	<td  class="frmLabel" colspan="2">Log Content<br/>
	<hr/>
	<div class="fleft" style="width:350px;line-height:2.5em;">
	<div class="msgBox">Before Change</div>
	<?
	foreach($log_old as $key=>$val){
	
	$hclass="";
	if (array_key_exists($key, $log_diff)) $hclass="highlightr";
	
	echo "<div class='".$hclass."'><b>".$key."</b>  :   ".$val."</div>";
	
	}
	?>
	
	
	</div>
	</div>
	<div class="fright" style="width:350px;line-height:2.5em;">
	<div class="msgBox">After Change</div>
	<?
	foreach($log_new as $key=>$val){
	
	$hclass="";
	if (array_key_exists($key, $log_diff)) $hclass="highlightg";
	
	echo "<div class='".$hclass."'><b>".$key."</b>  :   ".$val."</div>";
	
	}
	?>
	
	
	</div>
	

	</td>
	
</tr>
<? } ?>
</table>


</div>
<? include("includes/footer.php"); ?>